<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../study/js/vue.js"></script>
</head>

<body>
<div id="app">
    <h1 v-html="info"></h1>
    <h1 v-html="button"></h1>
    <hr>
    <button @click.once="addh2">点我增加一行</button>
    <button @click="addButton">点我增加一个按钮</button>
</div>
</body>
<script>
    var vue = new Vue({
        el: "#app",
        data: {
            info:'<h2>haha</h2>',
            button:'<button>haha,我是新增的按钮</button>'
        },
        methods:{
            addh2(){
                this.info = this.info + '<h2>haha，我是新增的一行</h2>'
            },
            addButton(){
                this.button = this.button + '<button>haha,我是新增的按钮</button>'
            }
        }
    })
</script>

</html>